
						<!-- <li>
							<a class="update-pro" href="#downloads/klorofil-pro-bootstrap-admin-dashboard-template/?utm_source=klorofil&utm_medium=template&utm_campaign=KlorofilPro" title="Upgrade to Pro" target="_blank"><i class="fa fa-rocket"></i> <span>UPGRADE TO PRO</span></a>
						</li> -->
					
		
		<!-- END NAVBAR -->
		<!-- LEFT SIDEBAR -->
		<style type="text/css">
		#id{
			width: 500px;
			height: 300px;
			background: #ccc;
		}
		.rule{
			margin-top:30px;
			width:500px;
			height:45px;
			background:#0f0;
			font-size: 30px;
		}

		.int{
			margin-top:15px;
			margin-left:52px;
			border-bottom: 1px solid #000;
		}

		</style>
							
								
		
							<!-- INPUT SIZING -->
							<div class="panel">
								<div class="panel-heading">
									<h3 class="panel-title">角色编辑</h3>
								</div>
								<div class="panel-body">
								<form action="" method="post" enctype="multipart/form-data">
									<input class="form-control input-lg" placeholder="角色名称" type="text" name="name" value="<?php echo $arr['name']?>"> 
									<br>
									
									<label>是否启用
									<input type="radio" <?php echo $arr['status']?'checked':'';?> name="status" value="1">是
									<input type="radio" <?php echo $arr['status']?'':'checked';?> name="status" value="0">否
									</label>
									<button>提交</button>

									<div id="id">

										<div class="rule">权限管理
										<input id="qx" type="button" name="" value="全选">
										<input id="fx" type="button" name="" value="反选">
										</div>
										<?php foreach($date as $v){?>
										<input class="gual" style="margin-left:30px;font-size:30px;" type="checkbox" <?php echo (in_array($v['id'],$arr['power']))?'checked':'';?>  name="power[]" value="<?php echo $v['id']?>"><?php echo $v['name']?>
										
										<div class="int">
										<?php foreach($dates as $vs){
											if($v['id']==$vs['pid']){ ?>

											<input type="checkbox" <?php echo (in_array($vs['id'],$arr['power']))?'checked':'';?> name="power[]" value="<?php echo $vs['id']?>"><?php echo $vs['name']?>
											<?php } 
											} ?>
											<!-- <input type="checkbox" name="">新闻删除
											<input type="checkbox" name="">新闻修改 -->
										</div>

										<?php }  ?>

										
										

									</div>

									<button type="submit" class="btn btn-primary btn-lg btn-block">添加</button>
									</form>
								</div>
							</div>
							<!-- END INPUT SIZING -->
						
							<!-- END INPUT GROUPS -->
						
		
	<!-- END WRAPPER -->
	<!-- Javascript -->
	<script src="resources/admin/assets/vendor/jquery/jquery.min.js"></script>
	<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
	<script src="assets/vendor/jquery-slimscroll/jquery.slimscroll.min.js"></script>
	<script src="assets/scripts/klorofil-common.js"></script>

 <script type="text/javascript">
 		$(function(){

 			$('#id>input').click(function(){
 				$(this).next().find(':checkbox').prop('checked',$(this).prop('checked'));
 				
 				// if (check!=true) {
 					
 				// 	$(this).next().find(':checkbox').prop('checked',true);
 				// }else{
 					
 				// 	$(this).next().find(':checkbox').prop('checked',false);
 				// }
 			})	


 			$('#id>div>input').click(function(){
 				
 				$(this).parent().prev().prop('checked',true);
 				var check=$(this).parent().find(':checkbox:checked').length;
 				/*alert(check)*/
 				if (check==0) {
 					
 					$(this).parent().prev().prop('checked',false);
 				}
 				
 				
 			})

 			$('#qx').click(function(){
 				var check=$(this).parents('#id').find(':checkbox:checked').length;
 				
 				if (!check) {
 					
 					$(this).parents('#id').find(':checkbox').prop('checked',true);
 				}else{

 					$(this).parents('#id').find(':checkbox').prop('checked',false);
 				}
 				
 			})

 			$('#fx').click(function(){
 				var check=$(this).parents('#id').find(':checkbox');
 				/*var qx=$(this).parents('#id').find(':checkbox:checked').length;*/
 		/*		var bx=$(this).parents('#id').find(':checkbox:checked').length;*/
 				/*alert(bx)*/
 				 
 				check.each(function(i,o){
 					if($(o).is(':checked')){
 						alert(1)
 						$(this).parents('#id').find(':checkbox').prop('checked',false);
 					}else{
 						alert(2)
 						$(this).parents('#id').find(':checkbox').prop('checked',true);
 					}

 				})
 				/*if (!qx) {

 					$(this).parents('#id').find(':checkbox').prop('checked',true);
 					
 					
 				}else{

 					$(this).parents('#id').find(':checkbox').prop('checked',false);
 				}	*/
 					 
 				
 				
 			})
 		
})
 </script>